package com.devunion.bogdan.view.actions.annotations;

import com.devunion.bogdan.util.IconHelper;
import com.devunion.bogdan.view.editors.PageEditorHelper;
import com.devunion.bogdan.view.model.ZoomComboBoxModel;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * @author Viktar Liaskovich
 */
public class ZoomAction extends AbstractAction {

    public ZoomAction() {
//        super(null, IconHelper.getIcon("ShowHideAnnotations16.gif"));
//        putValue(Action.LARGE_ICON_KEY, IconHelper.getIcon("ShowHideAnnotations24.gif"));
    }

    public void actionPerformed(ActionEvent e) {
        JComboBox s = (JComboBox) e.getSource();
        PageEditorHelper.getInstance().getEditor().zoom(((ZoomComboBoxModel.ZoomRatio) s.getSelectedItem()).getZoom());
    }
}